package com.kuaiditu.assistant;

import android.app.Application;

import com.alibaba.android.arouter.launcher.ARouter;
import com.baidu.mapapi.SDKInitializer;
import com.blankj.utilcode.util.Utils;
import com.idescout.sql.SqlScoutServer;
import com.kuaiditu.assistant.dagger.components.AppComponent;
import com.kuaiditu.assistant.dagger.components.DaggerAppComponent;
import com.kuaiditu.assistant.dagger.modules.AppModule;
import com.kuaiditu.assistant.util.ToastUtil;
import com.miguelbcr.ui.rx_paparazzo2.RxPaparazzo;

/**
 * Created by Eenie on 2017/8/29.
 * Email: eeniework@gmail.com
 * Des:
 */

public class App extends Application{
    private AppComponent mAppComponent;


    @Override
    public void onCreate() {
        super.onCreate();
        inject();
        SDKInitializer.initialize(this);
        ARouter.openDebug();
        ARouter.openLog();
        ARouter.init(this);
        ToastUtil.register(this);
        Utils.init(this);
        RxPaparazzo.register(this);
        SqlScoutServer.create(this, getPackageName());
    }

    private void inject() {
        mAppComponent = DaggerAppComponent
                .builder()
                .appModule(new AppModule(this))
                .build();
        mAppComponent.inject(this);
    }



    public AppComponent getApplicationComponent() {
        return mAppComponent;
    }

}
